namespace ActiveSupport.Access
{
    public static class AccessExtensions
    {
        public static char At(this string text, int position)
        {
            return text[position];
        }

        public static char First(this string text)
        {
            return text[0];
        }

        public static string First(this string text, int limit)
        {
            return text.Substring(0, limit);
        }

        public static string From(this string text, int startingPosition)
        {
            return text.Substring(startingPosition, text.Length - startingPosition);
        }

        public static char Last(this string text)
        {
            return text[text.Length - 1];
        }

        public static string Last(this string text, int limit)
        {
            return text.Substring(text.Length - limit, limit);
        }

        public static string To(this string text, int endingPosition)
        {
            return text.Substring(0, endingPosition + 1);
        }
    }
}